some improvement for interactive mode