heap: refactor/simplify some more