moving animation to a separate class