How many functions is too much?

I am working on a datapack that detects when a custom_model_data flint_and_steel is used and gives an advancement for it. The advancement runs a raycast that gives found tnt entities a certain tag. Now I want to do the exact same but for a flint_and_steel with a different custom model data, and give the tnt a different tag. Is it the most efficient way to do this to use separate functions for everything: add another start_raycast and raycast function, for every time I want to tag it differently / use a different advanement? Or is there a better way? And for funtions: is it better to have more functions and less code in each function, or less funtions and more code in each function?
Continue to help post