Arrow’s theorem and the Gibbard-Satterthwaite theorem: a unified approach