add internal makeObjectiveFunction and make use of it in makeSingleObjectiveFunction