migrate code to new flow