Use std:: functions for better performance