Improve performance of dictionary