Add more flexible button functionality