Change functions in markov diffusion into classes