Removed duplicated factory code from config

Removed closure from config to enable caching. If you don't want to use the profiler you should disable the module instead of deleting the adapter class.