Rule 5 doesn't seem to get a lot of attention but I've refactored many complicated nested branchy functions into a table over the years, and it almost always improves speed, size, and ease of future modification.