Simplify a couple of calculations