build proper structs