refactor throwExistException