clean up and remove dead code