This code looks similar to the code that searches for planets for refueling. Are the pieces of code sufficiently similar that it would make sense to go to a common search function that is used in both situations?