Collect UI state initialization in one place.