Last part of jsmodule factory