- determine remote commands
- improve failure handling