Just about any self-respecting geek worthy of the title has amassed a significant collection of older hardware and accessories. You never know when you might need that old Pentium II motherboard or that dot-matrix printer, and who cares if that hard drive is only 40GB, it still works! Personally, until very recently I still had every single cell phone I ever owned since 1997. Your closets, desk drawers, and storage rooms are probably a PC archaeologist’s treasure trove of ancient technology, but it’s probably also time for you to let it go and clean out the junk. But if you remember the old adage “one man’s trash is another man’s treasure” and you consider just what goes into manufacturing all that technology, you sure don’t want to just let that stuff go to a landfill. Here are six tips to consider when cleaning out the closet.

1. Refurbish versus recycle

First and foremost, look at each piece of technology you want to get rid of and sort it into the “still useful” versus the “good only for salvage” pile. If it’s so old it won’t even run a current distro of Linux, or so small you have SD cards that store more, or damaged to the point that even you never got around to fixing it, don’t think that donating it will help it find a second life with someone else. Tech that has no practical and useful value today needs to be recycled. The number of precious metals in the average cellphone or computer and the environmental impact that went into refining those metals makes recycling a critical effort. Find a company that specializes in technology recycling rather than just chucking those old pieces into the green bin. While specialists can reclaim significant amounts of old tech, your local municipal recycling center may just reroute all of that gear to the landfill. If in doubt, call to confirm.

If it’ still useful then consider whether you want to refurbish it yourself or sell/donate it to a company that will refurbish it. There are several organizations out there that will take older, but still working, computers, refurbish them and provide them to low-income families or equip labs in libraries or community centers to provide people with access to the Internet and to learn basic computing skills.

2. Wipe your drives

Whether you are recycling or donating, make sure you wipe your data from any drive or other media that you do not destroy. My go-to tool for that is DBAN. Free and based on open-source software, this bootable image can securely wipe any drive you mount so that you can be sure none of your data remains. But if you cannot even mount a drive to wipe it with DBAN, destroy it and get it recycled to be sure your data is safe.

3. Reset those phones

Smartphones carry an amazing amount of personal data. Consider all your contacts, emails, texts, photos, and the credentials you have saved in every app you installed. Before you donate a phone, go through the complete wipe and reset process to be sure you don’t give away something that could be used to read your emails, disarm your alarm, or anything else.

4. Confirm it works

Don’t donate anything to a charity that doesn’t work. Plug it in, boot it up, and confirm it works, or just send it to recycling. Goodwill and other charities can make good use of your older working tech, but shouldn’t be used as an alternative to the rubbish bin.

5. Make sure it’s usable

If you are going to donate it, whether to a charity or a community center or church group or school, get it working. You can take older computers and install Linux or restore the factory image that came with the PC so that the device is at least useful to whomever ultimately gets it. Make sure any power cables that are required are included and marked, since so many pieces of tech have proprietary AC adapters. Again, if you don’t have the time to do this, look at a refurbishment or recycling option instead of a donation, as it’s unlikely most charities will be able to make use of a piece of equipment that won’t boot. While most phones these days all use USB adapters to charge, making sure you include a charger is a great way to help charities get working phones into the hands of those who need them.

6. Keep records

If you are donating to charity, keep good records of what you donated. Pictures are a good thing to keep too. In the US, donations to charity can be deducted from your taxes (if you itemize) but you want to make sure you have sufficient documentation to prove any deductions you claimed.

If you have old technology taking up space and you’re never going to get around to doing anything with it (and let’s face it, you aren’t) donating, recycling, or refurbishing all that gear can help you, the environment, and others, as well as clearing out much needed storage space. Use these six tips to do so with a purpose, ensure you aren’t just passing along trash to someone else, and make sure you aren’t leaking data.