Use transactions throughout the code