Replace array_key_exists with isset to improve performance