In imperative code, you have things, such as if statements, that determine what happens next. Taken in moderation, there's nothing wrong with this type of construct. But when your main avenue of logic is imperative statements, things tend to grow unmaintainable quickly.
The alternative to this imperative style is to compose your logic declaratively. Maps are the first tool that will help you get there.