refactoring archecture