Handle metadata on document