Added some UTs.
Moved initializations to constructor.