buffer refactoring preparations
- all marked with ***REFACBUF***