Refactor supporting https urls