- [fixed] small functionality fixes
- [clean] cleaning and reordering of the code