refined command and user response handling