more tranistion code cleanup and unification