Simplify button code