purge redundant code
slightly fixed
purge incorrect comment
[WIP] improve redirection
[WIP] improve redirection
[WIP] close_fds
[WIP] improve redirection