Refactor into subtemplates.
Go block black magic.
Add array decoding.