Redesign data structure and flow