refactor out subprocess.Popen() and getting stdout to new function get_stdout()