Additional refactoration changes
Refactoring and adding comments