They are better off not selling handsets anymore. Even Samsung and Apple will start to feel massive pressure on their margins sometime soon. Handset technology is leveling off and generic manufacturers are getting better at making them. It is much like what had happen to HDTVs recently. Sure there is "the ecosystem", but with Android the white box manufacturers get that for free too.
So yes Nokia squandered a huge lead in handset tech, but getting rid of the division has helped them a lot