Refactor: use swap assignment