copy the belady3 changes to belady (only cleanups so far, no new functionality yet)