refactored script
refactored script