refactor for easy swap of prod/dev auth.