graphics: updated optimizer logic into base optimizer class