core: refactor session making into helper