The data structure does not look very clean. Nested structure can better be realized using structs, which has the benefit of autocompletion and better code checks in IDEs and tools.