We propose a framework for modelling stochastic systems with variable diffusion rates which satisfy detailed balance (or in other terminology, time-reversibility). Rather than specifying the dynamics through a state-dependent drift and diffusion coefficients, we specify an equilibrium probability density and a state-dependent diffusion coefficient. We argue that our framework is more natural from the modelling point of view and has a distinct advantage in situations where either the equilibrium probability density or the diffusion coefficient is discontinuous. We introduce a numerical method for simulating dynamics in our framework that samples from the equilibrium probability density exactly and elegantly handles discontinuities in the coefficients. This is joint work with Xin Yang.