We present an analytical formulation for the study of state transfer in a spin chain in the presence of an inhomogeneous set of exchange coefficients. We initially consider the homogeneous case and describe our method to obtain the energy spectrum of the system. Under certain conditions, the state transfer time can be predicted by taking into account the gap between the two lowest energy eigenvalues. We then generalize our approach to the inhomogeneous case and show that including a barrier between two spins - which effectively reduces the numerical value of the coupling between them - can have the counterintuitive effect of reducing the state transfer time. We additionally extend our analysis to the case of multiple barriers. Our results may contribute to the understanding of spin transfer dynamics in long chains where connections between neighbouring spins can be manipulated.