Refactor

* Little code refactor
* New API
* New options
* Tests