Move implement of method to cpp.