Have you checked the various existing template-like approach we have in gaia ? (I don't know them much to be fair)