no globals in new code. make session depend on db