Slight cleanup and reformatting, no logic changes