refine when into buttons