Modifications from comments by @bsideup on the PR