Kia optima flickering headlights

Has anyone cleaned the battery connections? You need to find a good independent mechanic who can check all the battery connections and make sure they are clean and tight. There are just too many possibilities to name them all. I would also have the mechanic install a ground between the engine and frame.