Further clean ups in cython code