Full refactoring