Refactor crypto string