code review and code refactoring