One issue with this is that inner classes capture references to their outer. In this case, that is needless, but the scala compiler does it anyway. This may complicate serialization of UnqueID if that ever needs to happen.