Refactoring. Added script to add animation to a layer