Add Ctrl+Q and Ctrl+W shortcuts and improved code clarity