refactor: splits out url parsing into funcs, adds tests

Created by  tetov  on March 1, 2026
V77QIO7XMPRA6RRUR36ZXI5KEEPROE6BYJZB23SFDVLQRV6EOGHAC
Change contents