WIP: Extract document metadata into separate behavior.