consolidate url parsing logic into urlManager