Indeed, it's a more elegant solution. I will try that, and update the PR.