integrate unit-tests to the functions