#178 rework commit 5997264

(cherry picked from commit 1eb8fd893116c05a9921755946425c16e29d50f0)
#178 rework commit 669a74d

(cherry picked from commit 09e9e3de38a0626ebc0c256362faa3b5aefec1cd)
#178 remove unused method

(cherry picked from commit 69efb315fda1ecf5028e11b66bbaf40343f4aed6)