This method and the following could potentially go in their own class.