refactor failed