refine class hierarchy