moved functions from fqutil.c to util.[h|c]