Refactored collection scripts