I have a preference of my templates not having this much logic.  Use attributes and walk `@sync_with` and enumerate it to reduce the line count here.