Simplify a little bit the `in_array` verification

This is alao a logically different approach, no? What if the allowed types propert changes? Would the class still fulfill the same problem?