Remove unnecessary code and format