Refactor to start to centralize the env-var configuration for system components, also start to add test coverage so we can be sure we haven't broken things!