Some cleaning of old code