refactoring with config file