performance fix

using default dictionary as static variable, which is initialized only
once