Refactoring some code and removing some unecessary comments