Refactor ServiceProviderGenerator