Refactor code for CrypTalker