Moved utilities to separate file.