condense code for clicking/hovering on buttons