refactoring the monolith