make more use of pattern matching...