turn the session and context into interfaces, for easier replacement