Refine MiniShell code