This section has some Coding Standard violations. Fixing the elseif's would also make this a bit more compact.