refactoring to two simple examples, one for animation one for static