Refactor base64 nsdata