Personally, I feel that putting this code in a beginTransaction method spoils the readability of the code, especially as beginTransaction is only called from here, same for commitT