Refactor
* Refactored all code
* Fixed failing test due to Refactor