Externalize listener class