I'm pretty sure you can use `if (!handles[type])` here.