restructure listener