refactoring for html for event buttons in various views