manual rebase from clochix/visi2, replaces #517

* [ ] Test manually