big architecture refactoring