Separated config parsing into separate function