Revert "Rewrote listener class"

This reverts commit 0311209b9b662966a9fffd0d645a978ad7f6a3bf.