Moved template installs to functions for shared code