refactoring, comments, tests