initial move and refactor for trtools.tools.composition