Moved metadata conversion out of module