Architecture refactoring