Some formatting fixes and unused code removal