in principle finished with #5385, could use some testing...