refactoring because of code review