Better directory structure.
Refactoring and tests