Added withSharing
Handle generalization while avoiding generalizing boxities