if you set the dependencies in the define call this change is not needed any more, one remark though: doing such change would require to change the indentation of almost the complete code below (and the doc comment above). To make the diff shorter and the history easier to read, in such case, it's better to declare the variable first and then a few line below to set its value.

By the way, in this particular case, you can also skip this variable and directly return the function.