Better hash, array, and array of hashes checking