move $action to define in class not template

I think this is more in keeping with what you want.