code refactoring first step