[mod] refactor heap into one class