refactor

move session functions to modules, ...