[mod] simplify heap implementation