improved metadata handlisng