Could probably benefit from refactoring to use `in_array()`.