More work on entities and metadata