refine lookup files script