wip
improve implementation and tests
simplify helper