Early return would make this code easier to read.