Refactoring due to code review