extracted factory to init the internal loader