Improve config file fetch method.

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>