Refactoring

What changed
============

* Refactoring to improve code base