Improve key generation.