styling changes and cleaning up some code