Combined some edits into a State monad.