Improved register method

* Refactored tests package
* Refactored register method.
* Added some documentation