Remove $db form $ref