Changing to Optimizer interface, cleaning things up.