eliminate loop helper variables