Maybe the Base64 operations could be wrapped put into their own methods for reusability and readability?