Feature/refactoring

* Be DRY !
* Write sample code for #7