Implemented a better listener framework.