@dmathieu I implemented your suggestions, please have a look at this PR again. Thanks!