refine loading script