refactor
communicate with interactive subprocess