Add unit tests and changes related