fix: removed repetitive .length lookup