Use structs instead of int arrays

Change-Id: I6fe24fe208f91eb15a5291f296aa908cf923b519