Refactoring done and Comments Added