Refactor mutability