Abstract out some state arithmetic.