Also move the implementation of some methods from the .cc to the .hh
Add unit test and integration test