Clean up apparently dead (and not thread safe) code