Handle resolution scopes

@titanous 
I don't like the level of indentation here, one option is to parse both URLs at the same level and then check all of the conditions in a single `if`. Other approaches are welcome as well.