refactored base64 and string stuff into BASE