Listener is refactored to support several commands