[OE-3987] unit tests
[OE-3987] unit testing and refactoring