removing unused code and formatting