Refactor duplicate attachment code in EC2