Refactoring Plugins - Adding toTemplate functions