General style cleanup and reordering