Use anonymous class syntax to cut down the cruft.