Fix inputing multiple operator.

Also some refactor for reducing unnecessary code.