First refactoring try