Refactoring code 4.