Simplify swap! functions