improve mode class
reduce cpu usage in minimize mode