fix issue in unit test
Optimize tests
Update after @imotov review