Refactor MinPriorityQueue