Factor out Parser interface for common nextX functionality.