pull.sh refactoring