Refine code and entry structures