fix whitespace and small, local restructuring