Updated to use structs instead of single object