add argument parsing and simplify URL creation