1. optimize select dictionary function.