- refactor;
- added some tests