Reformat onRequest checking to else ifs and return once at the end.