Moved record struct and associated functions to model package