Refactoring and now we can use http/https via CLI options