sorted category value render fail fixing #41
DRYed out the templates a bit #41