better metadata handling, still far from what i'd like