More modifications towards optimizer