Template functions update and mark.
A more effective function mark.