Refactoring to split services into separate classes and cleaner DI.