Some cleaning to the codes