Housekeeping and deleting dead code