merge handler and listener