Thank you for the suggestion. I've just updated the PR to simplify the code.