~ update modules, code refactoring

Signed-off-by: Vladimir Bulyga <xx@ccxx.cc>