Code sample from "Scala Design Patterns" by John Hunt