moved session creation code to a separate file