Tested encrypt, started refactor