Abstract integer value swap to function