clean up generatekey