clean up code and edit style