Added other comments for review and a bit of refactoring