move some implementation into cpp, add skip routine