refactored listener method
refactored listener method