remove unaccessed codes and clean up