refine compile script