Refactor and enhancements of the animation subsystem