Refactoring and redirecting of buttons