Refactoring listeners to be more generic in setup