refine class bugs fixed