Implement template interpolation