cleaning up funnel code