Isolate common shell functionality