extracted a factory from serviceprovider which has no dependency of silex