refine class define codes