unit tests updated
code review and improvements