remove redundant null check
flush X connection after each event processed
added debug logging
removed unused class
added error logging
added logging
better logging format
added error logging