Refactoring code 2.