using inner class for processing event handling (hides callback functions from public API)