Flatten compiled templates