Script DRYing/refactoring & clean-up/purging