Simplified button generation code.