modify UiLifecycleHelper that it can use any SessionFactory to create new Session instances.