clean up bad code, console.logs and status codes