refactoring memory management in transpose composite operator generation