[TASK] Use better implementation for array check