remove the cast here and put it on optimizedSelf.