refactor: move binary heap out of the queue