added test phases
added _entityname field for references