Refactoring after changing architecture