better metadata handling