Remove code duplication for parsing info/refs