cleanup in semantic reference