improved implementation of Listener module