delete_ref(): move declaration to refs.h