It seems really overkill to me to create a PartialFunction just to check if a condition is true.