Make functions immutable.
Simplify the time dimension.
Create update function for template dimension.