Creating separate class for listener.