Factor out clearing of DataStore state to a method