Removing unnecessary loop