refactoring of scripts tasks