Clean up unused variables, enable network initiation, and extract midi wait logic.