cleanup & allowing to use a hostname instead of full url