Split out utilities to a file, removed unnecessary comments