Improvements to button functionality