refactoring
rewrote listener module