Refacture & expand the test coverage