move some stuff to the cpp