minor cleanup and refactor in animation generator (1)