Reduced swapAnimation function as much as reasonable.
Remaining TODO from previous commit still holds.