All of this initialization code is a good use case for a test class.