I agree the template would be shorter than the hand-crafted code, but couldn't you just write a loop to generate the 12 lines?   That would also get rid of the hardcoding to 12, FWIW.