fix a couple of errors with log and with missing url to check
Some initial refactoring