Split Session::run into smaller functions