Global refactoring, introduce more comment, centralize the management of deviceHeader.