Using number primitive type in animator.ts
Refactor to shorten animate code