Refactoring to load project as https or http