Cleaning

Cleaning and restructuring (Understanding the code)