use flat structure and send type info