Utility functions for Flask apps