Remove old optimization code