ctypes backend: split up