enhance interactive shell functionality. optimize other code