restructure to make the new UI work