A little test refactoring and adding listener test