overhaul to sveltify ditto handling