lots of refactoring
animation fixes