Added ListenerFactory and passing tests