add a test suite and some refactors