Remove redundant code and test.