Some cleaning of code