refactored a bit, switched to base32 encoding