code cleanup (Object Oriented) + add Revert action + add onAnimation callback