Improve transaction detection