Refactor heapitem into different classes