stave erasing and refactoring