Refactor out initConfig method