clean up handling of callbacks in metastore