Use url_or_username when not sure of input

i change the code a bit, so that we parse the url_or_username to a url or username and work with that. also i simplify the url methode