normalize metadata as late as possible