Use length variable for better perf