code refactoring part 1.1