move testing utility to testing file to avoid side effect of setting flag usage