Decouple trail logic from UI