refactor and generalize generator for overlapping block views
move function (forgotten in previous commit)