Refactoring: remove redundant code and comments