class optimizing