Refactor zipWithIndex