rearrange some lines
fix some formatting issues revealed by lint