Rearrange code

Last modified: 17 January 2023