optimizing class