Tests for web url and small refactor

:+1: on the tests!