variable optimizations and keymap