Move common functions to `util` namespace.