Cache the (expensive) trait lookup with `var rallypoint = a.TraitOrDefault<RallyPoint>()` and check it against `!= null` instead. You are using it twice in the next lines.