PIM-3131: Clean code to get previous and next product