Move the session handling of the Scheduler und Queries to a separate class