Remove Array_isArray function: use instanceof instead.
Refactor some code.