added logplusone type
refactored optimizers to make them abstract better.