This commit causes no change in trans semantics, it just moves some functions around and deduplicates them.