Refactor: Replace for (;;) with while (true)