refactored to BTEncryption