clean up and format source code