changes in functions and templates