Helper functions for templates

Hi

In my current setup, I have defined a few helper functions in my templates.

Since there is a lot of duplication, I would like to put these helper
functions
somewhere in the code tree where they would be accessible to all templates.

What would be the best place ?
Something like local/lib ?

Thanks
Gerard