add command line switch (--use-system-cares)
move code around