refactor base64