Included code to read/write external references from entities