Remove duplicated code for managing info/refs