cleanup and formatting fixes