The constructor of the repository are now public and the method
registerProvider use a function object to generate new providers, so the
use of memory was reduced.