Cleanup unused code and invalid comments