refactoring / session and sessionfactory