Use ES6 generator as event handler, fix the calling sequence to middleware -> event listener.