Functional template generator