Some improvements guided by the PR comments