Started restructuration of the code
With a clearer head and a better editor