Avoid getting slice twice