split code to make it easier to read
fix missing path and add more tests
clear documentation warnings