Refine code base