refactoring + animation improvements