Updated localization class for better performance