refactor session creation to abstract command