Refactored entire crypto