Refactoring concerning #480 about OAuth device identification