porting session helpers to shared classs