move metadata to the top of decoder for #7