You should move that (helper) function out of the tick function. That way, you will create only one function, instead of creating one each time `tick` is called.

This is a rule of thumb: creating a closure has a cost (and might be leak prone) - it has benefits, true, just not for that kind of helper function that doesn't *need* to access the local scope. 

Admittedly, it really is not a big deal here (`tick` being called quite sparsely) - just some generic advice.

2 cents nitpicking :-).