Treatment of functional diseases