separating the optimizer and the ui