I refactored all code to better the legibility and to more fast maintena...

...nce in the code, I wait which you accepted the new code.