some comments, refactoring