Some tidying up into structs.