Improved the performance by switching from containKey to get method