Refactoring: delete unnecessary methods and clean up code