Delegated the listener to an inner class