Remove unnecessary code in unit test