transaction code cleanup