refactored button to template
refactored button to template