use an inner class for the callback.