Using typeclasses for defining the Peer behavior