private function filterDuplicates($array)
    {
        $result = [];
        foreach ($array as $value) {
            if (!in_array($value, $result)) {
                $result[] = $value;
            }
        }
        return array_filter($result);
    }