Fix some formatting, move functions to Utility, remove more Console.WriteLine