Refactorizing

- Added some tests
- New structure
- Documentation