Class and unit tests refactor