Refactors data model to use structs