Convert to flask