handle_simple_cmd: code cleanups