change performace of get_metadata