Clean up in cython code