Macro joining Thrift structs.

Can you try and improve the readability of this file.

Some points:
* I'm not sure if there is much value to moving 1 or 2 lines into its own helper method if that method is not called multiple times. It can obfuscate the code.
* I would avoid things like exists(predicate), filter(predicate) instead just go for filter(predicate) and check if the result is empty.
* usually we have logic/the main execution thread at the top of the method and helper functions at the bottom.