Getbuttoninfo is always used the same and just a helper function. Shrinking it