mutable state removal