Lot of reorganization of the code!