refactor, some comments