performed code clean up and formatting