Refactoring check for next/alt