comments and code refactoring