Code cleanup in the unittest