I think it would be clearer if this anonymous class were pulled out into a separate variable, or made a nonymous class.