refactor length input type.