properly move optimizer