smarter functions