improved session and callbacks