Use State Machines!

FSMs are not as complex as you think and they make your code better.

You might also be interested in these articles...

Richard Clayton

Stumbling my way through the great wastelands of enterprise software development.