Refactoring

Close #5
Close #3
Close #3
Close #1
Merge pull request #7 from gianarb/feature/refactoring

Refactoring