Refactor so config is first variable