Read input through YAML file also in batch version.

(also remove unused lines of code)