Refactor ServiceManagerFactory