Remove unnecessary code in tests