using try-with-resource for config file loading