some cleanup and formatting fixes