refactor getHomeDir method in Config