Further clean up prioritize_queue method