Unittest refactor