move context initialisation to flow