saving stack space
casting > stack space
single switch -> if. however, this might have been a preparation for more cases to come later?
smarter looping for fun and profit
comment only commit. please review this loop
avoided a code repetition
for-loop is more suited for this kind of iteration