Trying to find the best way to parse URLs