refine code base