further cleanups and formatting fixes