some rework

Signed-off-by: Dmitry Ponyatov <dponyatov@gmail.com>