Refactoring IOptimalityFunction