Full test coverage (92.78%). fix critical bug. Improvements