document factory loading