perhaps extract this to a SessionService