Can we make this into one level of if {} else if {} else{}  and put the break outside the if/else ? this would make it clearer that only one path is being followed (and as an added benefit is slightly shorter).