Pushed some of the code from Main down to Utility class.