Simplify session handler logic