place button handlers references into a closure