refine subshell