refine lib interface