Convert to code_or_transpose.
Add more to code_or_transpose.
More refactoring.