Refactoring creation of Session Factory in test projects