Use maps instead of list dict to build JSON

[ci skip]