Refactor initConfig method to accept raw json