optimize resumeSession method