Refactoring. Put functions for work with config in separete files.