Better URL parsing and duplicate entry management