use "extends AnyVal" whenever possible

including taking advantage of the new ability of the required
`val` to be `private`