optimize readParams