Generic functions generator
Improve PHP template
Creation of template to JS