Add improvements and unit test to config reader