Refactoring.
Using >> and >>= instead of do. Using liftM where possible.