Denote by p(n) the number of partitions of n and by N(a,M;n) the number of partitions of n with rank congruent to a modulo M. By considering the deviation D(a,M):=∑n=0∞(N(a,M;n)−[Formula presented])qn, we give new proofs of recent results of Andrews, Berndt, Chan, Kim and Malik on mock theta functions and ranks of partitions. By considering deviations of cranks, we give new proofs of Lewis and Santa-Gadea's rank-crank identities. We revisit ranks and cranks modulus M=5 and 7, with our results on cranks appearing to be new. We also demonstrate how deviations of ranks and cranks resolve Lewis’ long-standing conjectures on identities and inequalities for rank-crank differences of modulus M=8.