Refactoring / moving adding of references to session to allow reuse of engine across scripts