Do you actually need to check all of these? Don't you just have to check `req.query.type`?