Small refacture, card key generation and signing working