Local heap refactoring