get rid of some redundant swap functions. Courtesy of Martin Schaffner <martin.schaf...