Refactor this into

```perl
if (exists($tree->{enable_service}) && @{$tree->{enable_service}}) {
    my $services = join(",",...)