reduce accesses to global variables
use std::array
control IME