Refactoring plugin CSRF