Performance improvements. Used valueOf instead of new Integer