Refactoring the providers factory so that an abstract one can handle everything