Refactor the method to refresh managedObject