Removing mutable type as a function argument