Finish cuda core part refactoring

And here.