refactoring of the code and tests