small update to $ref/$rep processing