shell code cleanups