cleanup in animation code