Move brightness workaround into its own function