Adding https support
Removing unused code