Moving utility functions to Util.cs.