Personally, if I’m going to the length of writing a function, I tend to shove all the code into said function.
BPM’s should be a stub, and ideally all widgets. Most of mine look like this:

Having said that, Functions intake and return tuples. Here’s an example.