Refactor getting subfield length to separate function.