move pattern matching of length' to duplicated function name