Extracted listner code to own classes