could all of the above generalize into smth like
```
if opt.startswith('action'):
   stream.append(head + [opt, self._opts[opt]])
```
?