code refactoring 3