moved auth and ssl setup to own methods