Reduce ref/deref operations by introducing swap() functions.