some cleanup in transaction code