Moving diff to formula function classes