Extracted common parts to separate methods Added get_stat_value() Signed-off-by: Daniel Madej <daniel.madej@huawei.com>