Remove unnecessary and wrong code