Refactored class to use the Struct class

Refactored the code to use the shorthand Struct class without nested
classes.