Move unrelated code away from session_test.go