Refactor templating mechanism

name is not very explicit, especially with a doc in the same context