Starting refactoring code