Clean up and unused code removal