Swapping classes refactored