Refactor transformations so that interfaces become less cluttered.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Fix prototypes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>