Fix bug decryption + small architectur improvement