Rebuilding framework for tpa handling