If we expect this to be called often, make this a static inner class (to avoid lots of anonymous classes)?