Take advantage of transactions. Move some code around. Cache credits to avoid re-adding if we don't need to.