Removing unnecessary comments and refactoring code