remove unnecessary loop