Reorder code (Audio,Video,Other) and removed unused variables.