Improve source key generation