refactoring architecture