Refactored to use service interfaces and implementations.