Refactor a bit with test_lib
Merge branch 'add-test_lib'