Remove unused method and fix build error