Improve remove next keyword behavior