listener refactoring WIP