Improved session management