Refactor and modifications in crypto.