Code refinements