Refactoring: findAvailablePlans is moved to plan.h.