Design by PartialFunction