Factor out collection functionality for better reusability
Implement attachment functions