Minor refactorings with PartialFunction.{cond, condOpt}