Added metadata flattener