Refactoring

Created separate listener class
Refactoring