Remove unused code and irrelevant comments