some changes + UnitTests