Migrating existing code to ServiceManager