Refactored yesterday spaghettii code
Merge pull request #4 from gbasile/master

Refactor