Final refactoring