refine code for usable