move chi into it's own module