Moved cclass code to separate file