Maybe you can come up with another way to accomplish the same goal with a few less if statements to make it a little more readable, but as far as efficiency goes, it looks fine. I do not see any unnecessary loops, which would effect the efficiency much more than a few extra if/else statements.