refactored some code into FlightManager.cs