ADD: extracting class for swaping routines