Extracted NHibernate implementation