core factory: port to es6 and add some refactory pills on loader