Replaced awkward struct object with a class.