Breaking up the case into pattern-matched function defs.