general stuff renaming and affine expression analyse
 - break into additional smaller functions.
 - etc.