Further split python and c functions