fix indentation
refactor get_metadata_items