move $action to define in class not template