Rearrange code
Clean this up