Reduce more nestings
Split prepareParameters into String and Array sub methods