improve class name handling