"get_val": added another unit-test and some small refactoring change