Efficient template blocks implementation