Your question is Owning a Test Automation Refactor. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Tell me about a time you inherited or stepped into a messy UI automation suite and had to improve its maintainability under delivery pressure. Walk me through how you decided what to refactor, how you handled ambiguity in the existing framework, and what results you achieved.