much better way to read metadata