Refactored code
Fixed typo
Merge pull request #81 from sylvaindeloux/refactor_code

Refactored code