(*) [CTL-42] Small code improvements and added first unit tests.