EndomorphismSLP refactoring for template parameter TerminalVertex