add test for config file option + some refactoring