Separate mutable and immutable operatins on world state. Optimize 'handle-message' function.