cleanup code and change some small styling issues