Remove unused code and do something code formatting