add the optimizer framework and some impl.