Cleaned up the transaction tree updating code