refactored script input