Add register factories function.