reducing & simplifying button code