remove debugging stuff and dead code