Refactor len variable.