refactor trema-switch command