Change DataSession to use generators instead of functions.