minor refactoring, comments