refactor session and add delivery features