some lambdas in optimizing states will be re-used in approximating
states: move them out as explicit functions