commenting and refactoring