More general cleaning, fixing of silly code and appropriate renaming.