Refactor animation-related logic: slidein, slideout