Removing duplicate code, refactoring comments.
Refactoring the code