Using internal handler API for applistener; part of #241.