Refactor out initConfig method
Merge pull request #27 from riking/refactoring

Refactor out initConfig method