Https and code cleanup